package model

import "gorm.io/gorm"

type Like struct {
	gorm.Model
	UserId   int `gorm:"type:int" json:"userId"`
	MomentId int `gorm:"type:int" json:"momentId"`
}

func (l *Like) VeryLike(db *gorm.DB, userId int, momentId int) error {
	return db.Debug().Where("user_id =? and moment_id=?", userId, momentId).First(&l).Error
}

func (l *Like) AddLike(db *gorm.DB) error {
	return db.Debug().Create(&l).Error
}
